#ifndef _KEY_H
	#define _KEY_H
	
#include "stm32f10x.h"
#include "i2c.h"

u8 PAin0(void);
u8 PAin8(void);
u8 PBin1(void);
u8 PBin2(void);

enum LCD_state{ LCD_state_showing,
LCD_state_setting_temperUp,
LCD_state_setting_wetUp,
LCD_state_setting_off,
LCD_state_setting_signal
};//LCD的所有状态

typedef struct{
	int temper;
	u8 wet;
	u16 time;
}Datadef;//数据结构体

extern Datadef data[100];
extern uint8_t num;

typedef struct {
	int temper_limit;
	u8 wet_limit;
	u8 catch_off;
	float test_signal;
}DataSetDef;//数据设定结构体

void write_data(unsigned char addr,unsigned char data);
void key_Init(void);
u8 key_scan(void);
void state_switch(void);
void write_data(unsigned char addr,unsigned char data);
unsigned char read_data(uint8_t addr);
void delay_ms(u32 nTime);
#endif